#include "CGeneralImage.h"

CGeneralImage::CGeneralImage()
{
}

CGeneralImage::~CGeneralImage()
{
	Reset();
}

void CGeneralImage::Reset()
{
	for(TInt i=0;i<iImageFrameArray.Count();i++) 
	{
		const TFrame& frame = iImageFrameArray[i];
		delete frame.iBitmap;
		delete frame.iBitmapMask;
	}
	iImageFrameArray.Close();
	
//	delete iImageDecoder;
//	iImageDecoder = NULL;	
}

void CGeneralImage::ConstructL()
	{
	iImageDecoder = CImageDecoderProcess::NewL(this);
	
	}

void CGeneralImage::Draw(CBitmapContext& aGc,const TRect& aRc,TSize aCorner,TInt aOpacity)
	{
	if(!iLocation.iValid)
		return;
	
	if(!iLoaded)
		return;
	
	
	}

TDesC& CGeneralImage::GetFileName()
{
	return iLocation.iFileName;
}

RArray<TFrame>* CGeneralImage::GetFrames()
{
	return &iImageFrameArray;
}

void CGeneralImage::LoadedCompleteNotify()
{
	iLoaded = ETrue;
	if(iImageFrameArray.Count() > 0)
		{
		TFrame& frame = iImageFrameArray[0];
		iSize = frame.iSize;
		}
}